package com.dmpp.mes.controller;


import com.dmpp.mes.bean.ResponseData;
import com.dmpp.mes.parameterInfo.Device;
import com.dmpp.mes.parameterInfo.RoutingProcess;
import com.dmpp.mes.service.DeviceService;
import com.dmpp.mes.service.RoutingProcessService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("RoutingProcess")
public class RoutingProcessController {
    //路线 工艺过程
    @Autowired
    private RoutingProcessService service;

    @RequestMapping(value = "/FindAll", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData findAll(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        return service.findAll();
    }

    @RequestMapping(value = "/FindById", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData findById(String id) {
        return service.findById(id);
    }

    @RequestMapping(value = "/UpdateById", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData updateById(RoutingProcess routingProcess) {
        return service.updateById(routingProcess);
    }

    @RequestMapping(value = "/Insert", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData insert(RoutingProcess routingProcess) {
        return service.insert(routingProcess);
    }

    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    @ResponseBody
    public ResponseData delete(String id) {
        return service.delete(id);
    }

}
